package templates;

import common.Application;
import utils.GenericPair;

public class PresentationTemplate {
    private Iterable<GenericPair<String, Boolean>> externals;
    private String nullValue;
    private short uid;
    private short propertyUid;
    private String alias;
    private String type;
    private String name;

    public PresentationTemplate(short uid, short propertyUid, String alias, String name, String type, String nullValue, Iterable<GenericPair<String, Boolean>> externals) {
        this.uid = uid;
        this.propertyUid = propertyUid;
        this.alias = alias;
        this.name = name;
        this.externals = externals;
        this.type = type;
        this.nullValue = nullValue;
    }

    public short getPropertyUid() {
        return propertyUid;
    }

    public PropertyTemplate getPropertyTemplate(Application app) {
        return app.getTemplate((short) (propertyUid & 0xFF00)).getPropertyTemplate(propertyUid);
    }

    public short getUid() {
        return uid;
    }

    public String getTypeName() {
        return type;
    }

    public String getName(){
        return name;
    }

    public Iterable<GenericPair<String, Boolean>> getExternals() {
        return externals;
    }

    public String getAlias() {
        return alias;
    }

    public String getNullValue() {
        return nullValue;
    }
}